package com.mobileares.midp.widgets.client.menu;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-11-14
 * Time: 10:56:09
 * To change this template use File | Settings | File Templates.
 */
public class GWTMenuItem extends MenuItem {
    private boolean enable = true;

    public GWTMenuItem(String text, Command cmd) {
        super(text, cmd);
    }

    public GWTMenuItem(String text, boolean asHTML, Command cmd) {
        super(text, asHTML, cmd);
    }

    public GWTMenuItem(String text, MenuBar subMenu) {
        super(text, subMenu);
    }

    public GWTMenuItem(String text, boolean asHTML, MenuBar subMenu) {
        super(text, asHTML, subMenu);
    }

    public void setEnable(boolean enable) {
        if (!enable)
            addStyleDependentName("disable");
        else
            removeStyleDependentName("disable");
        this.enable = enable;
    }

    public boolean isEnable() {
        return enable;
    }

}
